<template>
  <div>
    <div class="container">
      <!-- 左边的图片滑动盒子 -->
      <div class="image-slider">
        <img v-for="(item, index) in images" :key="index" :src="item" @error="onError(index)" @load="onLoad(index)"
          alt="" />
      </div>
      <!-- 右边的文字区域 -->
      <div class="text-box">
        <div>{{ text }}</div>
      </div>
    </div>
    <div class="footer">
      <div class="footer_left">
        合计：<text style="font-size: 18px;color: #f84c55;font-weight: 600;">￥18.7</text>
      </div>
      <div class="footer_right">
        <div class="footer_right_btn">结算</div>
      </div>
    </div>
  </div>
</template>

<script setup>
import { ref } from 'vue';

const images = [
  "/public/images/index-hua1.png",
  "/public/images/index-hua2.png",
  "/public/images/free03.png",
  "/public/images/free04.png",
  "/public/images/free05.png",
  "/public/images/index-hua6.png",
  "/public/images/index-hua7.png",
];

// 文本内容
const text = ref("推荐方案");

const onLoad = (index) => {
  // console.log(`Image ${index} loaded successfully`);
};

const onError = (index) => {
  // console.error(`Image ${index} failed to load`);
};
</script>

<style scoped>
.container {
  display: flex;
  padding: 10px 15px;
  box-sizing: border-box;
}

.image-slider {
  width: 70%;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none;
  height: 50px;
}

.text-box {
  width: 30%;
  padding: 10px;
  box-sizing: border-box;
  line-height: 30px;
  height: 50px;
  text-align: center;
}

.image-slider img {
  width: 50px;
  height: 50px;
  margin-right: 10px;
}
.footer{
  display: flex;
  justify-content: space-between;
  padding: 10px;
  border-top: 1px solid #ccc;
  box-sizing: border-box;
}
.footer_left{
  width: 40%;
  line-height: 40px;
  font-size: 14px;
}
.footer_right{
  width: 40%;
}
.footer_right_btn{
  width: 65%;
  float: right;
  text-align: center;
  padding: 10px 0;
  border-radius: 50px;
  background-color: #fc6355;
  color: #fff;
}
</style>